/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package photoshare.services;

import java.sql.SQLException;
import java.util.ArrayList;
import photoshare.dao.CategoryDAO;
import photoshare.dto.CategoryDTO;

/**
 *
 * @author PhotoShare
 */
public class CategoryService {

    public CategoryService() {
    }

    public boolean create(CategoryDTO categoryDTO) throws SQLException {
        return new CategoryDAO().create(categoryDTO);
    }

    public ArrayList<CategoryDTO> findAll() {
        return new CategoryDAO().readAll();
    }

    public CategoryDTO readById(Integer categoryId) {
        return new CategoryDAO().readById(categoryId);
    }

    public boolean updateById(CategoryDTO categoryDTO, Integer categoryId) throws SQLException {
        return new CategoryDAO().updateById(categoryDTO, categoryId);
    }

    public boolean deleteById(Integer categoryId) throws SQLException {

        return new CategoryDAO().deleteById(categoryId);
    }

}
